package com.googlecode.monitoring.ws.model;

import java.util.List;


public class TestFrameworkConfig {
	private String targetUrl;
	private String namespace;
	private String namespacePrefix;
	private String useCaseLocation;
	private List<String> useCaseFilters;
	private String testCaseLocation;
	private boolean useHeader;
	private CfpSecurity cfpSecurity;
	private CfpContext cfpContext;

	public TestFrameworkConfig() {
		super();
	}

	public TestFrameworkConfig(
		String targetUrl,
		String namespace,
		String namespacePrefix,
		String useCaseLocation,
		List<String> useCaseFilters,
		String testCaseLocation,
		boolean useHeader,
		CfpSecurity cfpSecurity,
		CfpContext cfpContext
	) {
		this.targetUrl = targetUrl;
		this.namespace = namespace;
		this.namespacePrefix = namespacePrefix;
		this.useCaseLocation = useCaseLocation;
		this.useCaseFilters = useCaseFilters;
		this.testCaseLocation = testCaseLocation;
		this.useHeader = useHeader;
		this.cfpSecurity = cfpSecurity;
		this.cfpContext = cfpContext;
	}

	public String getTargetUrl() {
		return targetUrl;
	}

	public void setTargetUrl(String targetUrl) {
		this.targetUrl = targetUrl;
	}

	public String getNamespace() {
		return namespace;
	}

	public void setNamespace(String namespace) {
		this.namespace = namespace;
	}

	public String getNamespacePrefix() {
		return namespacePrefix;
	}

	public void setNamespacePrefix(String namespacePrefix) {
		this.namespacePrefix = namespacePrefix;
	}

	public String getUseCaseLocation() {
		return useCaseLocation;
	}

	public void setUseCaseLocation(String useCaseLocation) {
		this.useCaseLocation = useCaseLocation;
	}

	public String getTestCaseLocation() {
		return testCaseLocation;
	}

	public void setTestCaseLocation(String testCaseLocation) {
		this.testCaseLocation = testCaseLocation;
	}

	public CfpSecurity getCfpSecurity() {
		return cfpSecurity;
	}

	public void setCfpSecurity(CfpSecurity cfpSecurity) {
		this.cfpSecurity = cfpSecurity;
	}

	public CfpContext getCfpContext() {
		return cfpContext;
	}

	public void setCfpContext(CfpContext cfpContext) {
		this.cfpContext = cfpContext;
	}

	public List<String> getUseCaseFilters() {
		return useCaseFilters;
	}

	public void setUseCaseFilters(List<String> useCaseFilters) {
		this.useCaseFilters = useCaseFilters;
	}

	@Override
	public String toString() {
		return "TestFrameworkConfig{" +
			"targetUrl='" + targetUrl + '\'' +
			", namespace='" + namespace + '\'' +
			", namespacePrefix='" + namespacePrefix + '\'' +
			", useCaseLocation='" + useCaseLocation + '\'' +
			", useCaseFilters=" + useCaseFilters +
			", testCaseLocation='" + testCaseLocation + '\'' +
			", useHeader=" + useHeader +
			", cfpSecurity=" + cfpSecurity +
			", cfpContext=" + cfpContext +
			'}';
	}

	public boolean isUseHeader() {
		return useHeader;
	}

	public void setUseHeader(boolean useHeader) {
		this.useHeader = useHeader;
	}

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof TestFrameworkConfig)) return false;

        TestFrameworkConfig that = (TestFrameworkConfig) o;

        if (useHeader != that.useHeader) return false;
        if (cfpContext != null ? !cfpContext.equals(that.cfpContext) : that.cfpContext != null) return false;
        if (cfpSecurity != null ? !cfpSecurity.equals(that.cfpSecurity) : that.cfpSecurity != null) return false;
        if (namespace != null ? !namespace.equals(that.namespace) : that.namespace != null) return false;
        if (namespacePrefix != null ? !namespacePrefix.equals(that.namespacePrefix) : that.namespacePrefix != null)
            return false;
        if (targetUrl != null ? !targetUrl.equals(that.targetUrl) : that.targetUrl != null) return false;
        if (testCaseLocation != null ? !testCaseLocation.equals(that.testCaseLocation) : that.testCaseLocation != null)
            return false;
        if (useCaseFilters != null ? !useCaseFilters.equals(that.useCaseFilters) : that.useCaseFilters != null)
            return false;
        if (useCaseLocation != null ? !useCaseLocation.equals(that.useCaseLocation) : that.useCaseLocation != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = targetUrl != null ? targetUrl.hashCode() : 0;
        result = 31 * result + (namespace != null ? namespace.hashCode() : 0);
        result = 31 * result + (namespacePrefix != null ? namespacePrefix.hashCode() : 0);
        result = 31 * result + (useCaseLocation != null ? useCaseLocation.hashCode() : 0);
        result = 31 * result + (useCaseFilters != null ? useCaseFilters.hashCode() : 0);
        result = 31 * result + (testCaseLocation != null ? testCaseLocation.hashCode() : 0);
        result = 31 * result + (useHeader ? 1 : 0);
        result = 31 * result + (cfpSecurity != null ? cfpSecurity.hashCode() : 0);
        result = 31 * result + (cfpContext != null ? cfpContext.hashCode() : 0);
        return result;
    }
}
